package ca.etsmtl.log430.lab2.donnee;

import ca.etsmtl.log430.lab2.gestion.Course;
import ca.etsmtl.log430.lab2.gestion.CourseList;
import java.util.*;
public class TeacherBean {
	/**
	 * Teacher's Last Name
	 */
	private String lastName;
	
	/**
	 * Teacher's First Name
	 */
	private String firstName;
	
	/**
	 * Teacher's identification number
	 */
	private String teacherID;
	
	/**
	 * teacher type (PRF = prof, CHR = charge de cours, e.g. T.A. in French)
	 */
	private String teacherType;

	/**
	 *  List of courses taken by the student
	 */
	private Collection<String> coursesTaughtList = new ArrayList<>();

	/**
	 *  List of courses the student is registered for
	 */
	private Collection<String>  coursesAssignedList = new ArrayList<>();

	/**
	 * Registers a student for a course by adding a student for a course.
	 * 
	 * @param course
	 */
	public void assignCourse(CourseBean course) {
		this.getCoursesAssignedList().add(course.getCourseID());
	} // Register

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((firstName == null) ? 0 : firstName.hashCode());
		result = prime * result
				+ ((lastName == null) ? 0 : lastName.hashCode());
		result = prime * result
				+ ((teacherID == null) ? 0 : teacherID.hashCode());
		result = prime * result
				+ ((teacherType == null) ? 0 : teacherType.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TeacherBean other = (TeacherBean) obj;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		if (teacherID == null) {
			if (other.teacherID != null)
				return false;
		} else if (!teacherID.equals(other.teacherID))
			return false;
		if (teacherType == null) {
			if (other.teacherType != null)
				return false;
		} else if (!teacherType.equals(other.teacherType))
			return false;
		return true;
	}

	public String getTeacherType() {
		return teacherType;
	}

	public void setTeacherType(String teacherType) {
		this.teacherType = teacherType;
	}

	public Collection<String> getCoursesAssignedList() {
		return coursesAssignedList;
	}

	public void setCoursesAssignedList(Collection<String> coursesAssignedList) {
		this.coursesAssignedList = coursesAssignedList;
	}

	public void setCoursesTaughtList(Collection<String> coursesTaughtList) {
		this.coursesTaughtList = coursesTaughtList;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setTeacherID(String teacherID) {
		this.teacherID = teacherID;
	}

	public String getTeacherID() {
		return teacherID;
	}

	public void setType(String teacherType) {
		this.teacherType = teacherType;
	}

	public String getType() {
		return teacherType;
	}



	public Collection<String> getCoursesTaughtList() {
		return coursesTaughtList;
	}




}
